//首页学习应试组件
import React from 'react';
import  { Component } from 'react';
import "./index.css";
import BookSVG from "../../Common/svg/Book";
import CoursewareSVG from "../../Common/svg/Courseware";
import ExamSVG from "../../Common/svg/Exam";
import ItemBankSVG from "../../Common/svg/ItemBank";

class StudyInfo extends Component {
    constructor(props){
        super();
        this.state={
            title:props.title,
            msg:props.msg,
            msg2:props.msg2,
            img:props.img
        }
    }
 render(){
     let ico="";
     switch(this.state.img){
        case "Book":
            ico=<BookSVG/>
            break;
        case "CoursewareSVG":
            ico=<CoursewareSVG/>
            break;    
        case "ItemBank":
            ico=<ItemBankSVG/>
            break; 
        case "Exam":
            ico=<ExamSVG/>
            break; 
        default:
            break;    
     }
     return(
         <div className="StudyInfo_Box">
             <div className="StudyInfo_Title">{this.state.title}</div>
             <div>
                <div className="StudyInfo_Msg">{this.state.msg}</div>
                <div className="StudyInfo_SVG">
                    <div className="StudyInfo_SVGBorder">
                        {ico}
                    </div>
                </div>
                <div className="StudyInfo_Msg">{this.state.msg2}</div>
             </div>
         </div>
     )
 }
}
export default StudyInfo;